﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Text.RegularExpressions;
using XamlCast.Player.Utils;

namespace XamlCast.Player.Model {
    public class PodcastItem {
        public string Title { get; set; }
        public string Description { get; set; }
        public DateTime PublishDate { get; set; }
        public Uri MediaUrl { get; set; }

        public string Slug {
            get {
                string result = string.Empty;

                if (!string.IsNullOrEmpty(this.Title)) {
                    result = string.Concat("/Podcasts/",
                        this.Title.ToLower().RemoveDiacritics().RegexReplace(@"[^\w]+", "-").ToLower().RegexReplace(@"[^\w]+$", string.Empty));
                }

                return result;
            }
        }
    }
}
